<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <meta>
  <!-- Stylesheets -->
  <link href="../web.css" type="text/css" rel="stylesheet"></link>
  <link href="../pygmentize.css" type="text/css" rel="stylesheet"></link>
  <title>VLFeat - Documentation - C API</title>
  <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>

  <!-- Scripts-->
  
 </meta>

 <!-- Body Start -->
 <body>
  <div id="header">
   <!-- Google CSE Search Box Begins -->
   <form action="http://www.vlfeat.org/search.html" method="get" id="cse-search-box" enctype="application/x-www-form-urlencoded">
    <div>
     <input type="hidden" name="cx" value="003215582122030917471:oq23albfeam"></input>
     <input type="hidden" name="cof" value="FORID:11"></input>
     <input type="hidden" name="ie" value="UTF-8"></input>
     <input type="text" name="q" size="31"></input>
     <input type="submit" name="sa" value="Search"></input>
    </div>
   </form>
   <script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" xml:space="preserve" type="text/javascript"></script>
   <!-- Google CSE Search Box Ends -->
   <h1><a shape="rect" href="../index.html" class="plain"><span id="vlfeat">VLFeat</span><span id="dotorg">.org</span></a></h1>
  </div>
  <div id="headbanner">
   Documentation - C API
  </div>
  <div id="pagebody">
   <div id="sidebar"> <!-- Navigation Start -->
    <ul>
<li><a href="../index.html">Home</a>
</li>
<li><a href="../download.html">Download</a>
</li>
<li><a href="../doc.html">Documentation</a>
<ul>
<li><a href="../mdoc/mdoc.html">Matlab API</a>
</li>
<li><a href="index.html" class='active' >C API</a>
</li>
<li><a href="../man/man.html">Man pages</a>
</li>
</ul></li>
<li><a href="../overview/tut.html">Tutorials</a>
</li>
<li><a href="../applications/apps.html">Applications</a>
</li>
</ul>

   </div> <!-- sidebar -->
   <div id="content">
    
    <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>
    <div class="doxygen">
<div>
<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">stringop.h File Reference</div>  </div>
</div>
<div class="contents">

<p>String operations.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="generic_8h.html">generic.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea71fca21ec3ae6a26edbe380fedc2ebec">VL_PROT_UNKNOWN</a> =  -1, 
<a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea94b2ad9436eeeb7e7a08baf24e00f3d6">VL_PROT_NONE</a> =  0, 
<a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea611cc6138919fdd98ce2a9137a762b91">VL_PROT_ASCII</a>, 
<a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9eaa92055b1172e1b8fa98177304d495653">VL_PROT_BINARY</a>
 }</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#a12595787245c1d92c5d3bbe6c0cea9f4">vl_string_copy</a> (char *destination, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> destinationSize, char const *source)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy string.  <a href="#a12595787245c1d92c5d3bbe6c0cea9f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#a3ecf896f613bca486a0821f076aa8855">vl_string_copy_sub</a> (char *destination, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> destinationSize, char const *beginning, char const *end)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy substring.  <a href="#a3ecf896f613bca486a0821f076aa8855"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#aa45c4b3fc38383ad1d152485ccfe3356">vl_string_parse_protocol</a> (char const *string, int *protocol)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the protocol prefix from a string.  <a href="#aa45c4b3fc38383ad1d152485ccfe3356"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#a79a3a25967d2fd344d3812c31f7af6d7">vl_string_protocol_name</a> (int prot)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get protocol name.  <a href="#a79a3a25967d2fd344d3812c31f7af6d7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#a7c19551fb6bb7e1f45c453caef5b9044">vl_string_basename</a> (char *destination, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> destinationSize, char const *source, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> maxNumStrippedExtension)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract base of file name.  <a href="#a7c19551fb6bb7e1f45c453caef5b9044"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#a3333f80d5012dadb8967ab297ff02645">vl_string_replace_wildcard</a> (char *destination, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> destinationSize, char const *src, char wildcardChar, char escapeChar, char const *replacement)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace wildcard characters by a string.  <a href="#a3333f80d5012dadb8967ab297ff02645"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#acc6a3ecad1c4fde280008c2bc7663dea">vl_string_find_char_rev</a> (char const *beginning, char const *end, char c)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Search character in reversed order.  <a href="#acc6a3ecad1c4fde280008c2bc7663dea"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#acc9de03bedf2b67ce907a7478e34bc4e">vl_string_length</a> (char const *string)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate string length.  <a href="#acc9de03bedf2b67ce907a7478e34bc4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stringop_8h.html#ad006cebd610a7a6f7b6d97c93e398824">vl_string_casei_cmp</a> (const char *string1, const char *string2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare strings case-insensitive.  <a href="#ad006cebd610a7a6f7b6d97c93e398824"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Andrea Vedaldi</dd></dl>
<p><a class="el" href="stringop_8h.html">stringop.h</a> implements basic string operations. All functions that write to strings use range checking, which makes them safer than some standard POSIX equivalent (see <a class="el" href="stringop_8h.html#vl-stringop-err">Detecting overflow</a>).</p>
<h2><a class="anchor" id="vl-stringop-file-protocols"></a>
File protocols</h2>
<p><a class="el" href="stringop_8h.html">stringop.h</a> defines a few file "protocols" and helps parsing them from URL-like formatted strings. The supported protocols are:</p>
<table class="doxtable">
<caption align="bottom">File protocols</caption>
<tr>
<td>Protocol</td><td>Code</td><td>URL prefix </td></tr>
<tr>
<td>ASCII</td><td><a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea611cc6138919fdd98ce2a9137a762b91">VL_PROT_ASCII</a></td><td><code>ascii://</code> </td></tr>
<tr>
<td>BINARY</td><td><a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9eaa92055b1172e1b8fa98177304d495653">VL_PROT_BINARY</a></td><td><code>binary://</code> </td></tr>
</table>
<h2><a class="anchor" id="vl-stringop-err"></a>
Detecting overflow</h2>
<p><a class="el" href="stringop_8h.html">stringop.h</a> functions that write a string to a character buffer take both the buffer and its size <code>n</code> as input. If <code>n</code> is not large enough, the output may be truncated but it is always a null terminated string (provided that <code>n</code> &gt;= 1). Such functions also return the length of the string that would have been written <code>r</code> (which does not include the terminating null character) had the buffer been large enough. Hence an <em>overflow</em> can be detected by testing if <code>r</code> &gt;= <code>n</code>, <code>r</code> can be used to re-allocate a buffer large enough to contain the result, and the operation can be repeated.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Andrea Vedaldi </dd></dl>
</div><hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="a61dadd085c1777f559549e05962b2c9e"></a><!-- doxytag: member="stringop.h::@5" ref="a61dadd085c1777f559549e05962b2c9e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a61dadd085c1777f559549e05962b2c9ea71fca21ec3ae6a26edbe380fedc2ebec"></a><!-- doxytag: member="VL_PROT_UNKNOWN" ref="a61dadd085c1777f559549e05962b2c9ea71fca21ec3ae6a26edbe380fedc2ebec" args="" -->VL_PROT_UNKNOWN</em>&nbsp;</td><td>
<p>unknown protocol </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a61dadd085c1777f559549e05962b2c9ea94b2ad9436eeeb7e7a08baf24e00f3d6"></a><!-- doxytag: member="VL_PROT_NONE" ref="a61dadd085c1777f559549e05962b2c9ea94b2ad9436eeeb7e7a08baf24e00f3d6" args="" -->VL_PROT_NONE</em>&nbsp;</td><td>
<p>no protocol </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a61dadd085c1777f559549e05962b2c9ea611cc6138919fdd98ce2a9137a762b91"></a><!-- doxytag: member="VL_PROT_ASCII" ref="a61dadd085c1777f559549e05962b2c9ea611cc6138919fdd98ce2a9137a762b91" args="" -->VL_PROT_ASCII</em>&nbsp;</td><td>
<p>ASCII protocol </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a61dadd085c1777f559549e05962b2c9eaa92055b1172e1b8fa98177304d495653"></a><!-- doxytag: member="VL_PROT_BINARY" ref="a61dadd085c1777f559549e05962b2c9eaa92055b1172e1b8fa98177304d495653" args="" -->VL_PROT_BINARY</em>&nbsp;</td><td>
<p>Binary protocol </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a7c19551fb6bb7e1f45c453caef5b9044"></a><!-- doxytag: member="stringop.h::vl_string_basename" ref="a7c19551fb6bb7e1f45c453caef5b9044" args="(char *destination, vl_size destinationSize, char const *source, vl_size maxNumStrippedExtension)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_string_basename </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>destination</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>destinationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>maxNumStrippedExtensions</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">destination</td><td>destination buffer. </td></tr>
    <tr><td class="paramname">destinationSize</td><td>size of destination buffer. </td></tr>
    <tr><td class="paramname">source</td><td>input string. </td></tr>
    <tr><td class="paramname">maxNumStrippedExtensions</td><td>maximum number of extensions to strip. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>length of the destination string.</dd></dl>
<p>The function removes the leading path and up to <code>maxNumStrippedExtensions</code> trailing extensions from the string <em>source</em> and writes the result to the buffer <em>destination</em>.</p>
<p>The leading path is the longest suffix that ends with either the <code>\</code> or <code>/</code> characters. An extension is a string starting with the <code>.</code> character not containing it. For instance, the string <code>file.png</code> contains the extension <code>.png</code> and the string <code>file.tar.gz</code> contains two extensions (<code>.tar</code> and <code><code></code>.gz</code>).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="stringop_8h.html#vl-stringop-err">Detecting overflow</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="ad006cebd610a7a6f7b6d97c93e398824"></a><!-- doxytag: member="stringop.h::vl_string_casei_cmp" ref="ad006cebd610a7a6f7b6d97c93e398824" args="(const char *string1, const char *string2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int vl_string_casei_cmp </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">string1</td><td>fisrt string. </td></tr>
    <tr><td class="paramname">string2</td><td>second string. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>an integer =,&lt;,&gt; 0 if <code>string1</code> =,&lt;,&gt; <code>string2</code> </dd></dl>

</div>
</div>
<a class="anchor" id="a12595787245c1d92c5d3bbe6c0cea9f4"></a><!-- doxytag: member="stringop.h::vl_string_copy" ref="a12595787245c1d92c5d3bbe6c0cea9f4" args="(char *destination, vl_size destinationSize, char const *source)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_string_copy </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>destination</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>destinationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">destination</td><td>output buffer. </td></tr>
    <tr><td class="paramname">destinationSize</td><td>size of the output buffer. </td></tr>
    <tr><td class="paramname">source</td><td>string to copy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>length of the source string.</dd></dl>
<p>The function copies the string <em>source</em> to the buffer <em>destination</em> of size <em>destinationSize</em>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="stringop_8h.html#vl-stringop-err">Detecting overflow</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a3ecf896f613bca486a0821f076aa8855"></a><!-- doxytag: member="stringop.h::vl_string_copy_sub" ref="a3ecf896f613bca486a0821f076aa8855" args="(char *destination, vl_size destinationSize, char const *beginning, char const *end)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_string_copy_sub </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>destination</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>destinationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>beginning</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>end</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">destination</td><td>output buffer. </td></tr>
    <tr><td class="paramname">destinationSize</td><td>size of output buffer. </td></tr>
    <tr><td class="paramname">beginning</td><td>start of the substring. </td></tr>
    <tr><td class="paramname">end</td><td>end of the substring. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>length of the destination string.</dd></dl>
<p>The function copies the substring from at <em>beginning</em> to <em>end</em> (not included) to the buffer <em>destination</em> of size <em>destinationSize</em>. If, however, the null character is found before <em>end</em>, the substring terminates there.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="stringop_8h.html#vl-stringop-err">Detecting overflow</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="acc6a3ecad1c4fde280008c2bc7663dea"></a><!-- doxytag: member="stringop.h::vl_string_find_char_rev" ref="acc6a3ecad1c4fde280008c2bc7663dea" args="(char const *beginning, char const *end, char c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* vl_string_find_char_rev </td>
          <td>(</td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>beginning</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">beginning</td><td>pointer to the substring beginning. </td></tr>
    <tr><td class="paramname">end</td><td>pointer to the substring end. </td></tr>
    <tr><td class="paramname">c</td><td>character to search for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to last occurrence of <em>c</em>, or 0 if none.</dd></dl>
<p>The function searches for the last occurrence of the character <em>c</em> in the substring from <em>beg</em> to <em>end</em> (the latter not being included). </p>

</div>
</div>
<a class="anchor" id="acc9de03bedf2b67ce907a7478e34bc4e"></a><!-- doxytag: member="stringop.h::vl_string_length" ref="acc9de03bedf2b67ce907a7478e34bc4e" args="(char const *string)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_string_length </td>
          <td>(</td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>string</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>string. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>string length. </dd></dl>

</div>
</div>
<a class="anchor" id="aa45c4b3fc38383ad1d152485ccfe3356"></a><!-- doxytag: member="stringop.h::vl_string_parse_protocol" ref="aa45c4b3fc38383ad1d152485ccfe3356" args="(char const *string, int *protocol)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* vl_string_parse_protocol </td>
          <td>(</td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>protocol</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>string. </td></tr>
    <tr><td class="paramname">protocol</td><td>protocol code (output). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to the first character after the protocol prefix.</dd></dl>
<p>The function extracts the prefix of the string <em>string</em> terminated by the first occurrence of the <code></code>:// substring (if any). It then matches the suffix terminated by <code></code>:// to the supported <a class="el" href="stringop_8h.html#vl-stringop-file-protocols">File protocols</a> protocols. If <code>protocol</code> is not <code>NULL</code>, the corresponding protocol code is written to <em>protocol</em> </p>
<p>The function writes to <em>protocol</em> the value <a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea94b2ad9436eeeb7e7a08baf24e00f3d6">VL_PROT_NONE</a> if no suffix is detected and <a class="el" href="stringop_8h.html#a61dadd085c1777f559549e05962b2c9ea71fca21ec3ae6a26edbe380fedc2ebec">VL_PROT_UNKNOWN</a> if there is a suffix but it cannot be matched to any of the supported protocols. </p>

</div>
</div>
<a class="anchor" id="a79a3a25967d2fd344d3812c31f7af6d7"></a><!-- doxytag: member="stringop.h::vl_string_protocol_name" ref="a79a3a25967d2fd344d3812c31f7af6d7" args="(int prot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char const* vl_string_protocol_name </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>protocol</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">protocol</td><td>protocol code. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer protocol name string.</dd></dl>
<p>The function returns a pointer to a string containing the name of the protocol <em>protocol</em> (see the <em>vl-file-protocols</em> protocols list). If the protocol is unknown the function returns the empty string. </p>

</div>
</div>
<a class="anchor" id="a3333f80d5012dadb8967ab297ff02645"></a><!-- doxytag: member="stringop.h::vl_string_replace_wildcard" ref="a3333f80d5012dadb8967ab297ff02645" args="(char *destination, vl_size destinationSize, char const *src, char wildcardChar, char escapeChar, char const *replacement)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_string_replace_wildcard </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>destination</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>destinationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>wildcardChar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>escapeChar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const *&#160;</td>
          <td class="paramname"><em>replacement</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">destination</td><td>output buffer. </td></tr>
    <tr><td class="paramname">destinationSize</td><td>size of the output buffer. </td></tr>
    <tr><td class="paramname">source</td><td>input string. </td></tr>
    <tr><td class="paramname">wildcardChar</td><td>wildcard character. </td></tr>
    <tr><td class="paramname">escapeChar</td><td>escape character. </td></tr>
    <tr><td class="paramname">replacement</td><td>replacement string.</td></tr>
  </table>
  </dd>
</dl>
<p>The function replaces the occurrence of the specified wildcard character <em>wildcardChar</em> by the string <em>replacement</em>. The result is written to the buffer <em>destination</em> of size <em>destinationSize</em>.</p>
<p>Wildcard characters may be escaped by preceding them by the <em>esc</em> character. More in general, anything following an occurrence of <em>esc</em> character is copied verbatim. To disable the escape characters simply set <em>esc</em> to 0.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>length of the result. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="stringop_8h.html#vl-stringop-err">Detecting overflow</a>. </dd></dl>

</div>
</div>
</div>
     <!-- Doc Here -->
    </div>
   
   </div>
   <div class="clear">&nbsp;</div>
  </div> <!-- pagebody -->
  <div id="footer">
   &copy; 2007-12 Andrea Vedaldi and Brian Fulkerson
  </div> <!-- footer -->

  <!-- Google Analytics Begins -->
  <script xml:space="preserve" type="text/javascript">
   //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   }
   //]]>
  </script>
  <script xml:space="preserve" type="text/javascript">
    //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {

   try {
   var pageTracker = _gat._getTracker("UA-4936091-2");
   pageTracker._trackPageview();
   } catch(err) {}

   }
   //]]>
  </script>
  <!-- Google Analytics Ends -->
 </body>
</html>

 
